class CreateZhishis < ActiveRecord::Migration
  def self.up
    create_table :zhishis do |t|
      t.string :username, :null => false, :limit => 20, :default => ""
      t.string :title, :null => false, :limit => 30, :default => ""
      t.string :tags, :null => false, :default => ""
      t.text   :content, :null => false, :default => ""

      t.timestamps
    end
    
    add_index :zhishis, :username
    
  end

  def self.down
    drop_table :zhishis
  end
end